//
//  MXHomeNoticeView.m
//  HNBaseProject
//
//  Created by xujie on 2024/6/1.
//

#import "MXHomeNoticeView.h"

@implementation MXHomeNoticeView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createUI];
    }
    return self;
}

- (void)createUI {
    self.userInteractionEnabled = YES;
    self.icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_message"]];
    self.icon.contentMode = UIViewContentModeCenter;
    [self addSubview:self.icon];
    
    self.numLab = [[UILabel alloc] init];
    self.numLab.backgroundColor = [UIColor dc_colorWithHexString:@"#FF0000"];
    self.numLab.textAlignment = NSTextAlignmentCenter;
    self.numLab.textColor = [UIColor whiteColor];
    self.numLab.layer.cornerRadius = 4.5;
    self.numLab.layer.masksToBounds = YES;
    self.numLab.font = PFRFontMedium(7);
    self.numLab.text = @"1";
    [self addSubview:self.numLab];
    
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.offset(0);
    }];
    
    [self.numLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.mas_equalTo(9);
        make.top.right.offset(0);
    }];
    self.numLab.hidden = YES;
}

@end
